#include "Renderer/FrameWindowRenderer.h"
#include "Control/GUIFrameWindow.h"
#include "Scheme/GUIWidgetLookManager.h"

namespace YGUI
{
    const String FrameWindowRenderer::TypeName("FrameWindow");

    FrameWindowRenderer::FrameWindowRenderer(const String& type) : WindowRenderer(type)
    {
    }

    void FrameWindowRenderer::render(void)
    {
        FrameWindow* frm = (FrameWindow*)m_window;
        String state = "InactiveWithTitleWithFrame";
        try
        {
            const WidgetLook& look = getLook();
            const StateImagery& imagery = look.getStateImagery(state);
            imagery.render(*frm);
        }
        catch(...) 
        { }
    }

    Rect<float> FrameWindowRenderer::getUnclippedClientRect(void) const
    {
        const FrameWindow* frm = static_cast<const FrameWindow*>(m_window);

        return WindowRenderer::getUnclippedClientRect();
    }
}